/**
 * 
 */
package br.srv.full.virtual.engine.auth;

import java.util.List;

import br.srv.full.virtual.entities.auth.Role;
import br.srv.full.virtual.entities.menu.MenuBase;
import br.srv.full.virtual.entities.menu.MenuGroup;
import br.srv.full.virtual.entities.menu.MenuItem;

/**
 * @author Delfino
 * 
 */
public interface AuthManager {

	/**
	 * Executa no beanManager a funçao:
	 * 
	 * find(MenuGroup.class, MenuGroup.FIND_BY_ROLES, l_arrayRoles);
	 * 
	 * find(MenuGroup.class, MenuGroup.FIND_RULES_NULL_OR_NO_RULES)
	 * 
	 * @param <menu>
	 * @param p_menuClazz
	 * @param p_role
	 * @return
	 */
	<menu extends MenuBase> List<menu> getMenus(Class<menu> p_menuClazz, Role... p_role);

	<menu extends MenuBase> List<menu> getMenus(Class<menu> p_menuClazz, List<Role> p_role);

	/**
	 * Retorna o menu conforme o nome informado.
	 * 
	 * @param <menu>
	 * @param p_menuClazz
	 * @param p_name
	 * @return
	 */
	<menu extends MenuBase> menu getMenu(Class<menu> p_menuClazz, String p_name);

	/**
	 * find(MenuItem.class, MenuItem.FIND_PER_GROUP_AND_ROLES, p_group, p_rules)
	 * 
	 * {@link MenuItem#FIND_BY_GROUP_AND_NO_ROLES}
	 */
	<menu extends MenuBase> List<menu> getMenus(Class<menu> p_class, MenuGroup p_group, Role... p_roles);

	<menu extends MenuBase> List<menu> getMenus(Class<menu> p_class, MenuGroup p_group, List<Role> p_roles);

}
